<?php
  require(dirname(__FILE__)."/../RequestMethod.php");
  require(dirname(__FILE__)."/../model/UserModel.php");
  class ResolveController extends RequestMethod{
      private $userModel = null;
      /**
      *构造函数，实例化对象
      */
      public function __construct(){

          $this->userModel = new UserModel();
      }
      /**
      *GET请求方法
      */
      public function doGet(){

      }
      /**
      *POST请求方法
      */
      public function doPost(){
          $action = $_GET['action'];
          switch ($action) {
            case 'login':
              $userName=$_POST['userName'];
              $passWord = $_POST['passWord'];
              $result=$this->userModel->checkUser($userName,$passWord);
              break;
            case 'logout':
              break;
          }
          echo json_encode($result);
      }

  }
?>
